package leetcode;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
class node
{
    int val = 0;
    node left = null;
    node right = null;
    public node(int val) {
        this.val = val;
    }
}

public class LeetCodeMain72 {
    public static int calNum(int num, int n){
        int count=0;
        while (num!=0){
            if (num%n==0){
                count++;
                num/=n;
            }else {
                break;
            }
        }
        return count;
    }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int num2=0;
        int num5=0;
        for (int i = 1; i <= n; i++) {
            num2+=calNum(i,2)*(n-i+1);
            num5+=calNum(i,5)*(n-i+1);
        }
        System.out.println(Math.min(num2,num5));
    }
    public static void main4(String[] args) {
        Scanner in=new Scanner(System.in);
        String str=in.nextLine();
        StringBuffer buffer=new StringBuffer();
        for (int i = 0; i < str.length();) {
            char ch=str.charAt(i);
            int count=0;
            int j = i+1;
            for (; j < str.length(); j++) {
                char ch1=str.charAt(j);
                if (ch1==ch){
                    count++;
                }else {
                    i=j;
                    break;
                }
            }
            if (count!=0){
                buffer.append(count);
            }
            buffer.append(ch);
            if (j==str.length()){
                break;
            }
        }
        System.out.println(buffer.toString());
    }
    public static void main3(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int ret=1;
        int sum=0;
        for (int i = 1; i <= n; i++) {
            ret*=i;
            sum+=ret;
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        Scanner in=new Scanner((System.in));
        int num=in.nextInt();
        int[] coins={1,2,5,10};
        int length=coins.length;
        int[][] dp=new int[length+1][num+1];
        for (int i = 0; i <= length; i++) {
            dp[i][0]=1;
        }
        for (int i = 1; i <= length; i++) {
            for (int j = 1; j <= num; j++) {
                if (j>=coins[i-1]){
                    dp[i][j]=(dp[i-1][j]+dp[i][j-coins[i-1]])% 1000000007;
                }else {
                    dp[i][j]=dp[i-1][j];
                }
            }
        }
        System.out.println(dp[length][num]);
    }


    public static int count=0;
    public static void main1(String[] args) {
        Scanner in=new Scanner(System.in);
        int money=in.nextInt();
        int[] coins={1,2,5,10};
        back(coins,0,0,money,coins.length);
        System.out.println(count);
    }
    public static void back(int[] coins,int sum,int startIndex,int money,int length){
        if (sum==money){
            count++;
        }
        for (int i = startIndex; i < length&&sum+coins[i]<=money; i++) {
            sum+=coins[i];
            back(coins, sum, i, money, length);
            sum-=coins[i];
        }
    }
}
